﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace PhotoProcess.PxlSDK
{
    //人脸关键点标定信息  (已经核对)
    [StructLayout(LayoutKind.Sequential)]
    public struct _FGFacePoint
    {
        public int faceType;			// 人脸类型 0:正面 1:左侧面 2:右侧面
        public int xleft;					// 左眼在原始图像中的位置   //int eyeX;	
        public int yleft;                                                 //int eyeY
        public int xright;					// 右眼在原始图像中的位置     //int noseTipX;	
        public int yright;                                                //int noseTipY;
        public int faceLeft;				// 人脸左边缘的X坐标，-1表示未知  //int headBackX;
        public int faceRight;				// 人脸右边缘的X坐标，-1表示未知  //int headBackY;
        public int headLeft;						// 人头左边缘的X坐标，-1表示未知
        public int headRight;						// 人头右边缘的X坐标，-1表示未知
        public int headTop;						// 头顶的Y坐标，-1表示未知
        public int chinPos;						// 下巴的Y坐标，-1表示未知
        public double skewAngle;					// 平面内偏斜角度 -181表示未知
    };

    // 图像检测特征数据结构
    [StructLayout(LayoutKind.Sequential)]
    public struct _FGDetectStdData
    {
        public int structSize;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 48)]
        public char[] name;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
        public char[] version;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
        public char[] date;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
        public char[] reserved;					// reserved

        public int ijpg;							// file format
        public int sz1, sz2;						// file size
        public int bits1, bits2;					// image bits
        public int dpi;							// DPI
        public int igr1, igr2;						// imgGrayRange
        public float iag1, iag2;					// imgAverageGrayscale
        public float ff1, ff2;						// faceFrontal
        public float fe1, fe2;						// faceExposure
        public float fu1, fu2;						// faceUniform
        public float fx1, fy1, fv1;				// fg a, b, l
        public float fx2, fy2, fv2;
        public float fh1, fh2;						// faceHotspots
        public float fb1, fb2;						// faceBlur
        public float eo1, eo2;						// eyesOpen
        public float eg1, eg2;						// eyesGlasses
        public float ef1, ef2;						// eyesFrontal
        public float fo1, fo2;						// faceOffset中心偏移
        public float ed1, ed2;						// eyesDistance

        public int bktype;							// 0: Monochromel; 1: Complex;
        public float bu1, bu2;						// bgUniform
        public float bx1, by1, bv1;				// bk a, b, l
        public float bx2, by2, bv2;

        public int nFaceType;						//正面、侧面、其它
        public int bKeepRatio;						//允许等比例缩放
        public int fWidth;							// width, height
        public int fHeight;
        public int fEyesDisMin;					//两眼距离
        public int fEyesDisMax;
        public int fFaceWidthMin;					//脸宽（耳朵内侧）
        public int fFaceWidthMax;
        public int fHeadWidthMin;					//头宽（耳朵外侧）
        public int fHeadWidthMax;
        public int fEyesYMin;						//眼睛Y位置
        public int fEyesYMax;
        public int fHeadHeightMin;					//头高（头顶到下巴）
        public int fHeadHeightMax;
        public int fHeadTopYMin;					//头顶
        public int fHeadTopYMax;

        // 严重不合格范围(颜色)
        public float dfx1, dfy1, dfv1;
        public float dfx2, dfy2, dfv2;
        public float dbx1, dby1, dbv1;
        public float dbx2, dby2, dbv2;

        public float lowcs1, lowcs2;				//灰蒙
        public float ffroll1, ffroll2;				//脸旋转
        public float ffyaw1, ffyaw2;				//脸侧转
        public float fhpitch1, fhpitch2;			//头俯昂
        public float gf1, gf2;						//眼镜架框
        public float gc1, gc2;						//眼镜片颜色深浅
        public float gflash1, gflash2;				//镜片反光
        public float ec1, ec2;						//眼睛被遮挡
        public float ered1, ered2;					//红眼
        public float fexp1, fexp2;					//表情自然
        public float mc1, mc2;						//嘴巴闭合
        public float noise1, noise2;				//图像噪声
        public float psss1, psss2;					//PS:磨皮    //add by ljz
        public float psos1, psos2;				    //PS:过度锐化

    };

    //图像检测结果数值
    [StructLayout(LayoutKind.Sequential)]
    public struct _FG_SDetectResult
    {
        // 照片属性
        public int faceCount;					// 照片人脸数

        // (-) 偏左，偏上 (+) 偏右，偏下
        public float faceroll;					// 脸旋转角度
        public float faceyaw;					// 脸侧转角度
        public float headpitch;					// 头俯昂角度

        public float faceUniform;				// 脸部光线均匀性
        public float faceHotspots;				// 脸部高光
        public float faceBlur;					// 脸部模糊度
        public float eyesOpen;					// 眼睛开闭
        public float eyesFrontal;				// 眼睛正视前方
        public float faceExpression;			// 表情自然
        public float eyesGlasses;				// 是否戴眼镜
    };

    //图像品质评价结构定义
    [StructLayout(LayoutKind.Sequential)]
    public struct _FG_SDetectAssess
    {
        [MarshalAs(UnmanagedType.I1)]
        public bool pass;						// 综合品质是否合格

        [MarshalAs(UnmanagedType.I1)]
        public bool hasface;					// 脸数（非单人正脸照）

        [MarshalAs(UnmanagedType.I1)]
        public bool eyesopen;					// 眼睛睁开
        [MarshalAs(UnmanagedType.I1)]
        public bool faceblur;					// 脸部模糊（图像模糊）
        [MarshalAs(UnmanagedType.I1)]
        public bool hotspots;					// 脸部高光
        [MarshalAs(UnmanagedType.I1)]
        public bool lightuniform;				// 脸部曝光均匀性（光照不均匀）

        [MarshalAs(UnmanagedType.I1)]
        public bool expression;					// 表情不自然
        [MarshalAs(UnmanagedType.I1)]
        public bool facefrontal;				// 正脸（姿态不正）
        [MarshalAs(UnmanagedType.I1)]
        public bool eyesfrontal;				// 正眼：眼睛朝前看（目光未视镜头）

        [MarshalAs(UnmanagedType.I1)]
        public bool headhigh;					// 头整体偏上
        [MarshalAs(UnmanagedType.I1)]
        public bool headlow;					// 头整体偏下
        [MarshalAs(UnmanagedType.I1)]
        public bool headleft;					// 头整体偏左
        [MarshalAs(UnmanagedType.I1)]
        public bool headright;					// 头整体偏右
        [MarshalAs(UnmanagedType.I1)]
        public bool largehead;					// 头（/脸）偏大
        [MarshalAs(UnmanagedType.I1)]
        public bool smallhead;					// 头（/脸）偏小
        [MarshalAs(UnmanagedType.I1)]
        public bool wearsglasses;				// 是否戴眼镜
    };

    //人脸跟踪定位结构 (已经核对)
    [StructLayout(LayoutKind.Sequential)]
    public struct _FGFaceLocation
    {
        public int id;							// 跟踪ID(暂不支持)
        public int x;							// 脸在图像中的右上角坐标 x
        public int y;							// 脸在图像中的右上角坐标 y
        public int width;						// 脸的宽度，-1表示未知
        public int height;						// 脸的高度，-1表示未知
        public float confidence;					// 脸的信度，-1表示未知
        public int xFirstEye;					// 第一只眼睛的 x 坐标
        public int yFirstEye;					// 第一只眼睛的 y 坐标
        public float firstConfidence;			// confidence for first eye，-1表示未知
        public int xSecondEye;					// 第二只眼睛的 x 坐标
        public int ySecondEye;					// 第二只眼睛的 y 坐标
        public float secondConfidence;			// confidence for second eye，-1表示未知
    };

    //6.3.	图像质量检测结果数值
    [StructLayout(LayoutKind.Sequential)]
    public struct _FGDetectResult
    {
        // 文件属性       
        /// <summary>
        /// 文件格式
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int fileFormat;

        /// <summary>
        /// 文件大小
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int fileSize;

        // 图像属性
        /// <summary>
        ///  图像宽度（像素）
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int imgWidth;

        /// <summary>
        /// 图像高度（像素）
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int imgHeight;

        /// <summary>
        /// 图像色彩位数
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int imgBits;

        /// <summary>
        /// 输出DPI（像素/英寸）
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int imgDpi;

        /// <summary>
        /// 图像损坏类型
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int imgCorrupt;

        /// <summary>
        /// 灰度动态范围[0,255]
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int imgGrayRange;

        /// <summary>
        /// 平均亮度（灰度）[0,255]
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float imgAverageGrayscale;

        /// <summary>
        /// 整体灰蒙[0,1]
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float imgLowContrast;

        /// <summary>
        ///  图像噪声
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float imgNoise;

        // 照片属性
        /// <summary>
        ///  照片人脸数
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int faceCount;

        /// <summary>
        /// 头宽
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int headWidth;

        /// <summary>
        /// 头高
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int headHeight;

        /// <summary>
        /// 脸宽
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int faceWidth;

        /// <summary>
        /// 头顶
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int headTop;

        /// <summary>
        ///  眼睛距离上边沿
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int eyeTop;

        // 水平垂直（像素）
        /// <summary>
        /// 居中偏移量
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int faceOffsetX;

        /// <summary>
        /// 水平垂直（像素）
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int faceOffsetY;

        // (+) 偏左，偏上(-) 偏右，偏下
        // 图像中心位置减去偏移量就得到人脸中心位置
        [MarshalAs(UnmanagedType.R4)]
        public float faceFrontal;				// 正脸

        /// <summary>
        /// 脸旋转角度
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float Faceroll;

        /// <summary>
        /// 脸侧转角度
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float Faceyaw;

        /// <summary>
        /// 头俯昂角度
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float Headpitch;

        /// <summary>
        /// 脸部曝光
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float faceExposure;

        /// <summary>
        /// 脸部光线均匀性
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float faceUniform;

        /// <summary>
        /// 脸部平均色彩
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float faceColorL;

        /// <summary>
        /// 脸部平均色彩
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float faceColorA;

        /// <summary>
        /// 脸部平均色彩
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float faceColorB;

        /// <summary>
        /// 脸部高光
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float faceHotspots;

        /// <summary>
        /// 脸部模糊度
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float faceBlur;

        /// <summary>
        /// 脸部锐度
        /// </summary>
        //[MarshalAs(UnmanagedType.R4)]
        //public float faceSharpness;

        /// <summary>
        ///  两眼距离
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyesDistance;

        /// <summary>
        /// 眼睛开闭
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyesOpen;

        /// <summary>
        /// 是否戴眼镜
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyesGlasses;

        /// <summary>
        /// 眼睛正视前方
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyesFrontal;

        /// <summary>
        /// 眼睛色彩
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyesColorL;

        /// <summary>
        /// 眼睛色彩
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyesColorA;

        /// <summary>
        /// 眼睛色彩
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyesColorB;

        /// <summary>
        /// 眼睛架框
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float glassFrame;

        /// <summary>
        ///  眼镜片颜色深浅
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float glassCover;

        /// <summary>
        /// 眼镜反光
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float glassFlash;

        /// <summary>
        /// 眼睛被遮挡
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyeCovered;

        /// <summary>
        /// 红眼
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float eyesRed;

        /// <summary>
        /// 表情自然
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float faceExpression;

        /// <summary>
        /// 嘴巴闭合
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float mouthClosed;

        // 背景属性
        /// <summary>
        /// 背景纯色(0,1)
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float bgPureColor;

        /// <summary>
        /// 背景均匀性(0,1)
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float bgUniform;

        /// <summary>
        /// 纯色背景的颜色
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float bgColorL;

        /// <summary>
        /// 纯色背景的颜色
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float bgColorA;

        /// <summary>
        /// 纯色背景的颜色
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float bgColorB;

        // PS效果检测
        /// <summary>
        ///  磨皮效果(0,1)
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float skinSmoothed;

        /// <summary>
        /// 	过度锐化(0,1)
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float overSharpened;

        /// <summary>
        /// 肩膀检测,-1右肩高，1左肩高，0正常
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int shoulderLine;  

        // 综合品质值
        /// <summary>
        /// 综合品质值
        /// </summary>
        [MarshalAs(UnmanagedType.R4)]
        public float detectQuality;
    };

    //6.6.	人脸跟踪定位结构
    [StructLayout(LayoutKind.Sequential)]
    public struct _FGDetectAssess
    {
        /// <summary>
        /// 综合品质是否合格
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool pass;

        /// <summary>
        /// 文件已损坏
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool fileCorrupt;

        /// <summary>
        /// 文件格式不符
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool fileFormat;

        /// <summary>
        /// 文件大小不符
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool fileSize;

        /// <summary>
        /// 图像高宽不符
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool imgWidHei;

        /// <summary>
        /// 色彩位数不符
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool imgBits;

        /// <summary>
        /// DPI不符
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool imgDPI;

        /// <summary>
        /// 相片有边框
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool imgBorders;

        /// <summary>
        /// 灰度范围    
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool grayrange;

        /// <summary>
        /// 平均灰度
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool averagegray;

        /// <summary>
        /// 图像噪声
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool imgNoise;

        /// <summary>
        /// 脸数（非单人正脸照）
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool hasface;

        /// <summary>
        /// 剪裁分辨率低
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool cropresolution;

        /// <summary>
        /// 两眼距离不合要求
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool eyedistance;

        /// <summary>
        ///  红眼
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool redeye;

        /// <summary>
        /// 眼睛睁开
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool eyesopen;

        /// <summary>
        /// 背景不均匀
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool bkuniform;

        /// <summary>
        /// 严重偏暗(-2) 偏暗(-1) 正常(0) 偏亮(1) 严重偏亮(2)  
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int backgroundcolorl;

        /// <summary>
        /// // 严重偏绿(-2) 偏绿(-1) 正常(0) 偏红(1) 严重偏红(2)  
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int backgroundcolora;

        /// <summary>
        /// 严重偏蓝(-2) 偏蓝(-1) 正常(0) 偏黄(1) 严重偏黄(2)
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int backgroundcolorb;

        /// <summary>
        /// 背景过亮
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool bklightover;

        /// <summary>
        /// 背景过暗
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool bklightunder;

        /// <summary>
        /// 背景颜色不合要求
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool bkcolor;

        /// <summary>
        /// 严重偏暗(-2) 偏暗(-1) 正常(0) 偏亮(1) 严重偏亮(2)  
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int facecolorl;

        /// <summary>
        /// 严重偏绿(-2) 偏绿(-1) 正常(0) 偏红(1) 严重偏红(2)
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int facecolora;

        /// <summary>
        /// 严重偏蓝(-2) 偏蓝(-1) 正常(0) 偏黄(1) 严重偏黄(2)
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int facecolorb;

        /// <summary>
        /// 整体（脸部）偏暗
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool lowbrightness;

        /// <summary>
        /// 整体（脸部）偏亮
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool highbrightness;

        /// <summary>
        /// 肤色不正常
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool skincolorun;

        /// <summary>
        /// 脸部模糊（图像模糊）
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool faceblur;

        /// <summary>
        ///  曝光不足
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool underexposure;

        /// <summary>
        /// 曝光过度
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool overexposure;

        /// <summary>
        /// 脸部高光
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool hotspots;

        /// <summary>
        /// 脸部曝光均匀性（光照不均匀）
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool lightuniform;

        /// <summary>
        /// 是否戴眼镜
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool wearsglasses;

        /// <summary>
        /// 眼镜框宽/色深
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool glassframe;

        /// <summary>
        /// /眼镜片颜色太深
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool glasscover;

        /// <summary>
        /// 眼镜反光
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool glassflash;

        /// <summary>
        ///  眼镜框遮挡眼睛
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool glasscovereye;

        /// <summary>
        /// 头发遮住眼睛
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool haircovereye;

        /// <summary>
        /// 眼睛被遮挡
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool eyecovered;

        /// <summary>
        /// 脸旋转-1：脸逆时针转，：脸顺时针转，没转
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int Faceroll;

        /// <summary>
        /// 脸侧转-1：脸向左侧转，：脸向右侧转，没转
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int Faceyaw;

        /// <summary>
        /// 头俯昂-1：头向下俯, 1：头向上昂，:不俯昂
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int Headpitch;

        /// <summary>
        /// 表情不自然
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool expression;

        /// <summary>
        /// 正脸（姿态不正）
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool facefrontal;

        /// <summary>
        /// 正眼：眼睛朝前看（目光未视镜头）
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool eyesfrontal;

        /// <summary>
        /// 整体偏色
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool colourcast;

        /// <summary>
        /// 整体发灰
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool lowcs;

        /// <summary>
        /// 服饰与背景色接近
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool colorWearUn;

        /// <summary>
        ///  嘴巴闭合
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool mouthclose;

        /// <summary>
        /// 头整体偏上
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool headhigh;

        /// <summary>
        /// 头整体偏下
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool headlow;

        /// <summary>
        /// 头整体偏左
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool headleft;

        /// <summary>
        /// 头整体偏右
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool headright;

        /// <summary>
        /// 头（/脸）偏大
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool largehead;

        /// <summary>
        /// 头（/脸）偏小
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool smallhead;

        /// <summary>
        ///  眼睛Y坐标
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool eyeYCood;

        /// <summary>
        /// 头顶距离
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool headTop;

        /// <summary>
        /// (-1,0,1) 偏小，通过，偏大
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int headHeightpass;

        /// <summary>
        /// (-3,-2,-1,1,2,3) 偏小，通过，偏大（负值为脸宽，正值为头宽）
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int faceheadWidthpass;

        // PS效果检测
        /// <summary>
        /// 磨皮效果
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool skinSmoothed;

        /// <summary>
        /// 过度锐化
        /// </summary>
        [MarshalAs(UnmanagedType.I1)]
        public bool overSharpened;

        /// <summary>
        /// 肩膀检测,-1右肩高，1左肩高，0正常
        /// </summary>
        [MarshalAs(UnmanagedType.I4)]
        public int shoulderLine;                   
    };

    //6.6.	人脸跟踪定位结构
    [StructLayout(LayoutKind.Sequential)]
    public struct _FGDetectAssessProfile
    {
        [MarshalAs(UnmanagedType.I1)]
        public bool fileCorrupt;					// 文件数据损坏
        [MarshalAs(UnmanagedType.I1)]
        public bool fileFormat;          		// 文件格式不符
        [MarshalAs(UnmanagedType.I1)]
        public bool fileSize;             		// 文件大小不符
        [MarshalAs(UnmanagedType.I1)]
        public bool imgWidHei;          		// 图像高宽不符
        [MarshalAs(UnmanagedType.I1)]
        public bool imgBits;              		// 色彩位数不符
        [MarshalAs(UnmanagedType.I1)]
        public bool imgDPI;             		// DPI不符
        [MarshalAs(UnmanagedType.I1)]
        public bool imgCorrupt;					// 图像缺损
        [MarshalAs(UnmanagedType.I1)]
        public bool grayrange;					// 灰度范围
        [MarshalAs(UnmanagedType.I1)]
        public bool averagegray;					// 平均灰度
        [MarshalAs(UnmanagedType.I1)]
        public bool hasface;						// 脸数（非单人正脸照）
        [MarshalAs(UnmanagedType.I1)]
        public bool cropresolution;				// 剪裁分辨率低
        [MarshalAs(UnmanagedType.I1)]
        public bool eyedistance;					// 两眼距离不合要求
        [MarshalAs(UnmanagedType.I1)]
        public bool redeye;						// 红眼
        [MarshalAs(UnmanagedType.I1)]
        public bool eyesopen;					// 眼睛睁开
        [MarshalAs(UnmanagedType.I1)]
        public bool bkuniform;					// 背景不均匀
        [MarshalAs(UnmanagedType.I1)]
        public bool bklightover;					// 背景过亮
        [MarshalAs(UnmanagedType.I1)]
        public bool bklightunder;					// 背景过暗
        [MarshalAs(UnmanagedType.I1)]
        public bool bkcolor;						// 背景颜色不合要求
        [MarshalAs(UnmanagedType.I1)]
        public bool lowbrightness;				// 整体（脸部）偏暗
        [MarshalAs(UnmanagedType.I1)]
        public bool highbrightness;				// 整体（脸部）偏亮
        [MarshalAs(UnmanagedType.I1)]
        public bool skincolorun;					// 肤色不正常
        [MarshalAs(UnmanagedType.I1)]
        public bool faceblur;						// 脸部模糊（图像模糊）
        [MarshalAs(UnmanagedType.I1)]
        public bool underexposure;				// 曝光不足
        [MarshalAs(UnmanagedType.I1)]
        public bool overexposure;				// 曝光过度
        [MarshalAs(UnmanagedType.I1)]
        public bool hotspots;						// 脸部高光
        [MarshalAs(UnmanagedType.I1)]
        public bool lightuniform;					// 脸部曝光均匀性（光照不均匀）
        [MarshalAs(UnmanagedType.I1)]
        public bool wearsglasses;					// 是否戴眼镜
        [MarshalAs(UnmanagedType.I1)]
        public bool glassframe;					// 眼镜框宽/色深
        [MarshalAs(UnmanagedType.I1)]
        public bool glasscover;					// 眼镜片颜色太深
        [MarshalAs(UnmanagedType.I1)]
        public bool glassflash;					// 眼镜反光
        [MarshalAs(UnmanagedType.I1)]
        public bool glasscovereye;				// 眼镜框遮挡眼睛
        [MarshalAs(UnmanagedType.I1)]
        public bool haircovereye;					// 头发遮住眼睛
        [MarshalAs(UnmanagedType.I1)]
        public bool expression;					// 表情不自然
        [MarshalAs(UnmanagedType.I1)]
        public bool facefrontal;					// 正脸（姿态不正）
        [MarshalAs(UnmanagedType.I1)]
        public bool eyesfrontal;					// 正眼：眼睛朝前看（目光未视镜头）
        [MarshalAs(UnmanagedType.I1)]
        public bool colourcast;					// 整体偏色
        [MarshalAs(UnmanagedType.I1)]
        public bool lowcs;						// 整体发灰
        [MarshalAs(UnmanagedType.I1)]
        public bool colorWearUn;				// 服饰与背景色接近
        [MarshalAs(UnmanagedType.I1)]
        public bool mouthclose;					// 嘴巴闭合
        [MarshalAs(UnmanagedType.I1)]
        public bool headhigh;					// 头整体偏上
        [MarshalAs(UnmanagedType.I1)]
        public bool headlow;						// 头整体偏下
        [MarshalAs(UnmanagedType.I1)]
        public bool headleft;						// 头整体偏左
        [MarshalAs(UnmanagedType.I1)]
        public bool headright;					// 头整体偏右
        [MarshalAs(UnmanagedType.I1)]
        public bool largehead;					// 头（/脸）偏大
        [MarshalAs(UnmanagedType.I1)]
        public bool smallhead;					// 头（/脸）偏小
        [MarshalAs(UnmanagedType.I1)]
        public bool eyeYCood;             		// 眼睛Y坐标
        [MarshalAs(UnmanagedType.I1)]
        public bool headTop;                	// 头顶距离
        [MarshalAs(UnmanagedType.I1)]
        public bool imgNoise;					// 图像噪声
        [MarshalAs(UnmanagedType.I1)]
        public bool skinSmoothed;				// 磨皮效果
        [MarshalAs(UnmanagedType.I1)]
        public bool overSharpened;				// 过度锐化
        [MarshalAs(UnmanagedType.I1)]
        public bool shoulderLine;				// 肩膀
    };

    [StructLayout(LayoutKind.Sequential)]
    public struct _FGDetectOption
    {
        [MarshalAs(UnmanagedType.I1)]
        public bool detEyes;						// 是否检测眼睛睁闭与正向
        [MarshalAs(UnmanagedType.I1)]
        public bool detGlasses;					// 是否检测眼镜
        [MarshalAs(UnmanagedType.I1)]
        public bool detExpress;					// 是否检测脸部表情
        [MarshalAs(UnmanagedType.I1)]
        public bool detMouth;					// 是否检测嘴巴闭合
        [MarshalAs(UnmanagedType.I1)]
        public bool detPS;						// 是否检测PS效果

        public float skewAngle;					// 自动调整->自动旋转幅度,多少度之内自动旋转，缺省为度
    };
}
